﻿namespace express.bttree;

public class AndNode : Node
{
    public AndNode(){}
    
    public override State execute(Context context) {
        foreach (Node child in this.children) {
            State ok = child.execute(context);
            if(ok == State.Break) {
                return State.Break;
            }
            if(ok == State.False) {
                return State.False;
            }
        }
        return State.True;
    }
}